package com.uchengwang.ui.cm_ui.umsg.ui;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;

import com.uchengwang.R;
import com.uchengwang.functions.http.config.BaseConfig;
import com.uchengwang.ui.base_ui.ui.BaseWithTitleActivity;
import com.uchengwang.ui.utils.LayoutAddViewUtils;

/**
 * Created by U城网 on 2017/7/26.
 * 社团类型
 */

public class ClubTypeActivity extends BaseWithTitleActivity{

    private LinearLayout fast_content;//动态添加界面布局
    private String[] fast_titles = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_fast_release);
        setTitle("社团类型");

        fast_titles = new String[]{"体育运动", "兴趣爱好", "学术科技", "实践公益", "文化艺术", "职能类", "其他"};

        initView();

    }

    private void initView() {
        fast_content = (LinearLayout) findViewById(R.id.fast_content);
        initData();
    }

    private void initData() {
        new LayoutAddViewUtils(this).addView(fast_content, fast_titles).setOnViewItemListener(new LayoutAddViewUtils.OnViewItemListener() {
            @Override
            public void onViewItem(View view, int position) {
                Intent intent = new Intent();
                intent.putExtra(BaseConfig.TYPE, fast_titles[position]);
                setResult(1, intent);
                ClubTypeActivity.this.finish();
            }
        });

    }
}
